package com.market.domain.entity;

import com.market.domain.vo.RuleLogicCheckTypeVO;
import lombok.*;

/**
 * 过滤规则后返回的动作实体
 * @param <T>
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class RuleActionEntity<T extends RuleActionEntity.RaffleEntity>{

    private String code = RuleLogicCheckTypeVO.ALLOW.getCode();
    private String info = RuleLogicCheckTypeVO.ALLOW.getInfo();
    private String ruleModel;
    private T data; //data类型为 T，即 RaffleEntity 或其子类

    static public class RaffleEntity {


    }

    //抽奖前过滤规则
    @EqualsAndHashCode(callSuper = true)
    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    static public class RaffleBeforeEntity extends RaffleEntity{
        /**
         * 策略ID
         */
        private Long strategyId;

        /**
         * 权重值Key；用于抽奖时可以选择权重抽奖。
         */
        private String ruleWeightValueKey;

        /**
         * 奖品ID;
         */
        private Integer awardId;
    }

    static public class RaffleCenterEntity extends RaffleEntity{

    }

    static public class RaffleAfterEntity extends RaffleEntity{

    }
}
